package create;

import Bean.CreateFileBean;
import model.ControllerModel;
import util.AllUtil;

import javax.annotation.Resource;

/**
 * Created by eleven on 16/1/2.
 */
public class CreateController {

    @Resource(name = "allUtil")
    private AllUtil allUtil ;

    public Boolean Write(CreateFileBean createFileBean){
        ControllerModel controllerModel = new ControllerModel();
        String text = controllerModel.basisDispatcht(createFileBean.getChinesename(),createFileBean.getDispatchname(),createFileBean.getDaoname(),createFileBean.getServicename(),createFileBean.getConsturl())+"\n"
                +controllerModel.basisSave(createFileBean.getChinesename(),createFileBean.getDispatchname(),createFileBean.getDaoname(),createFileBean.getServicename())+"\n";
        return allUtil.writeInSameFile(createFileBean.getControllerpath(),text);
    }
}
